<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML" 4.01"//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- Created: August 3, 2001-->

<html>
<head>
<title></title>
<meta name="author" content="Eugene Mah">
<link rev="made" href="mailto:eugenem@ix.netcom.com">
<link rev="home" href="http://home.netcom.com/~eugenem/"">
<meta name="description" content="">
<meta name="Keywords" content="">
<meta name="Reply-to" content="eugenem@ix.netcom.com">
<META http-equiv="PICS-Label" content='(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~0001))'>

<?
$host="localhost";
$user="eugenem";
$pwd="imabug";
$database="ComplianceReports";

require('functions.inc');

$link = mysql_connect($host, $user, $pwd)
  or die ("Could not connect<br>");
$db = mysql_select_db($database)
  or die ("Could not select database<br>");
?>
</head>

<body>
<h1></h1>

<!--
Logic operation tests
-->
<table border=1>
  <tr>
    <th>Flag</th><th>Linearity</th><th>Accuracy</th><th>BeamQual</th><th>Repro</th>
  </tr>
  
<?PHP
/*
  Define constants that indicate what each line is used for
*/
define("LINEARITY", 0x1);  // Low bit
define("ACCURACY", 0x2);
define("BEAMQUAL", 0x4);
define("REPRO", 0x8);  // High bit

$result = mysql_query("select UseFlags from GenData");
while ($row = mysql_fetch_row($result)) {
  $flag = $row[0];
  $lin = $flag & LINEARITY;
  $acc = $flag & ACCURACY;
  $beam = $flag & BEAMQUAL;
  $repro = $flag & REPRO;
  echo "<tr>\n";
  echo "<td>$flag</td>\n";
  echo "<td>$lin</td>\n";
  echo "<td>$acc</td>\n";
  echo "<td>$beam</td>\n";
  echo "<td>$repro</td>\n";
  echo "<tr>\n";
}

?>
<form action="<?echo $PHP_SELF?>" name="ModQuery" method="POST">
  Select Modality: <select name="modality" size=1 onChange="">
<?php

  $modality = mysql_query("select * from Modality");
  while (list($key,$val)=mysql_fetch_array($modality)) {
    if ("ID" == $key) {
      $selected="selected";
    }
    else {
      $selected="";
    }
    print "<option value=\"$key\" $selected>$val</option>\n";
  }
/*
  echo listbox_field($modality, "ModalityID", "ID");
  echo "<br>";
*/
  mysql_close($link);
?>
  </select>
<?
function selectModality() {
  $link = mysql_connect($host, $user, $pwd)
    or die ("Could not connect<br>");
  $db = mysql_select_db($database)
    or die ("Could not select database<br>");
  
  $query = "select * from Machines where ModalityID=$modality";
  $result = mysql_query($query);
  
  $numrows = mysql_num_rows($result)
    or die ("<p>No results returned</p>");
  
  print "<table>";
    while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
      print "  <tr>\n";
        while (list($col_name, $col_value) = each($line)) {
          print "    <td>$col_value</td>\n";
        }
      print "  </tr>\n";
    }
    print "</table>";
  mysql_close($link);
}
?>
</form>

 
<hr>
<font size=-2>
<address>
<a href="http://home.netcom.com/~eugenem/" target="_top">Eugene Mah</a> - <a href="mailto:eugenem@ix.netcom.com">eugenem@ix.netcom.com</a>
</address>
<tt><i>
<!-- hhmts start --> Last modified: Sat Aug 25 17:11:46 EDT 2001 <!-- hhmts end -->
</i></tt>
</font>
</body>
</html>
